<?php
#=================#
# ■ アイテム譲渡 #
#=================#
function ITEMJOUTO(){
global $in,$pref;

global $log,$bid,$id,$cl,$sex,$no,$f_name,$l_name,$sta,$hour,$min,$sec,$teamID;
$userlist = @file($pref['user_file']) or ERROR('unable to open user_file','','ITEM2',__FUNCTION__,__LINE__);
$sitei = $in['Command'];
$sitei = str_replace('SEITO_','',$sitei);

$wk2 = $in['Command2'];
$wk2 = str_replace('JO_','',$wk2);
$chk = true;
//敵GLOBAL
global $w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item,$w_eff,$w_itai,$w_log,$w_com,$w_dmes,$w_bid,$w_club,$w_money,$w_wp,$w_wg,$w_wn,$w_wc,$w_wd,$w_comm,$w_limit,$w_bb,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP;
for($i=0; $i<count($userlist); $i++){
	list($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_com,$w_dmes,$w_bid,$w_club,$w_money,$w_wp,$w_wg,$w_wn,$w_wc,$w_wd,$w_comm,$w_limit,$w_bb,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = explode(",",$userlist[$i]);
	if($w_id==$sitei){
		$chk = false;
		break;
	}
}
if($chk){ERROR('不正当登录','No such item exist','ITEM2',__FUNCTION__,__LINE__);}
BB_CK();
if(preg_match('/MAIN/',$wk2)){#伝言
	if(strlen($in['Dengon'])){
		$log .= '<font color="lime"><b>'.$f_name.' '.$l_name.'（'.$cl.' '.$sex.$no.'号）「'.$in['Dengon'].'」</b></font><br>';
		$w_log .= '<font color="lime"><b>'.$hour.':'.$min.':'.$sec.' '.$f_name.' '.$l_name.'（'.$cl.' '.$sex.$no.'号）「'.$in['Dengon'].'」</b></font><br>';
	}
	$log .= $w_cl.' '.$w_sex.$w_no.'号 '.$w_f_name.' '.$w_l_name.'收下了我的馈赠。<br>';
}else{
	global $item,$eff,$itai;
	list($itn2,$ik2) = explode('<>',$item[$wk2]);
	if($item[$wk2]=='无'){
		ERROR('不正当登录','Item does not exist','ITEM2',__FUNCTION__,__LINE__);
	}
	for($j=0; $j<5; $j++){
		if($w_item[$j]=='无'){
			$chk = true;
			break;
		}
	}
	if(!$chk){
		$log .= '对方的包包已经满了。<br>';
	}elseif($sta < $pref['jyouto_sta']){
		$log .= '没有转让的足够体力。<br>';
		$w_log .= '<font color="lime"><b>'.$cl.' '.$sex.$no.'号 '.$f_name.' '.$l_name.'虽然尝试转让不过对方体力不足。</b></font><br>';
	}elseif($w_sta < $pref['jyouto_w_sta']){
		$log .= '没有转让的足够体力。<br>';
		$w_log .= '<font color="lime"><b>'.$cl.' '.$sex.$no.'号 '.$f_name.' '.$l_name.'虽然尝试转让不过自己体力不足。</b></font><br>';
	}else{
		global $item_j;//NEWS用

		if(substr($ik2,0,1)=='H' || substr($ik2,0,1)=='S'){//回復系
			$item_j = $w_item[$j] = $item[$wk2];$w_eff[$j] = $eff[$wk2];$w_itai[$j] = 1;
			$itai[$wk2]--;
			if($itai[$wk2]<=0){
				$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
			}
		}else{//非回復系
			$item_j = $w_item[$j] = $item[$wk2];$w_eff[$j] = $eff[$wk2];$w_itai[$j] = $itai[$wk2];
			$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
		}

		$log .= $w_cl.' '.$w_sex.$w_no.'号 '.$w_f_name.' '.$w_l_name.'收到了'.$itn2.'。<br>';
		$w_log .= '<font color="lime"><b>'.$cl.' '.$sex.$no.'号 '.$f_name.' '.$l_name.'给了我'.$itn2.'。</b></font><br>';
		if(strlen($in['Dengon'])){
			$log .= '<font color="lime"><b>'.$f_name.' '.$l_name.'（'.$cl.' '.$sex.$no.'号）「'.$in['Dengon'].'」</b></font><br>';
			$w_log .= '<font color="lime"><b>'.$hour.':'.$min.':'.$sec.' '.$f_name.' '.$l_name.'（'.$cl.' '.$sex.$no.'号）「'.$in['Dengon'].'」</b></font><br>';
		}
		LOGSAVE('ITEM_J');
		//スタミナ消費
		$sta -= $pref['jyouto_sta'];
		$w_sta -= $pref['jyouto_w_sta'];
		if($pref['clb'][$in['club']]=='公益福利部'){
			$sta += 10;
			$hit += 10;
			if($sta>$pref['maxsta']){
				$sta = $pref['maxsta'];
			}
			if($hit>$mhit){
				$hit = $mhit;
			}
		}
	}
}

$in['Command'] = 'MAIN';
$in['Command2'] = 'DEBUG';

$w_bid = $id;
if($teamID!='无' && $teamID!=''){
	$w_bid .= '&'.$teamID;
}
$bid = $w_id;
if($w_teamID!='无' && $w_teamID!=''){
	$bid .= '&'.$w_teamID;
}

SAVE();
SAVE2();

}
#=================#
# ■ アイテム整理 #
#=================#
function ITEMSEIRI(){
global $in;

global $item,$eff,$itai,$log;

$wk = $in['Command'];
$wk = str_replace('SEIRI_','',$wk);
list($itn,$ik) = explode('<>',$item[$wk]);

$wk2 = $in['Command2'];
$wk2 = str_replace('SEIRI2_','',$wk2);
list($itn2,$ik2) = explode('<>',$item[$wk2]);
#絡められるられない？＆TEMP
$ik3 = '';

if($item[$wk]=='无' || $item[$wk2]=='无'){
	ERROR('不正当登录','item not found','ITEM2',__FUNCTION__,__LINE__);
}

$log .= '整理道具。<br>';

if($wk==$wk2){ #同アイテム選択？
	$log .= $itn.'被重新装入。<br>';
}elseif($itn==$itn2){#名前同一
	#回復アイテム整理（体力・スタミナ）
	if($eff[$wk]==$eff[$wk2] && substr($ik,0,1)==substr($ik2,0,1) && (substr($ik,0,1)=='H' || substr($ik,0,1)=='S')){
		if($ik == $ik2){//同一
			$ik3 = $ik;
		}elseif(substr($ik,1,1)=='H' || substr($ik2,1,1)=='H'){//どちらかがHealthy
			if(substr($ik,1,1)=='H'){
				$ik3 = $ik2;
			}else{
				$ik3 = $ik;
			}
		}elseif(substr($ik,0,2)==substr($ik2,0,2)){//ほぼ同一
			$rnd=0;
			if($itai[$wk]==$itai[$wk2]){
				$rnd=rand(0,1);
			}
			if($itai[$wk] > $itai[$wk2] || $rnd){
				$ik3 = $ik;
			}else{
				$ik3 = $ik2;
			}
			
		}else{//毒レベル違い
			if(substr($ik,2,1)=='2'){
				$ik3 = $ik;
			}elseif(substr($ik2,2,1)=='2'){
				$ik3 = $ik2;
			}elseif(substr($ik,2,1)=='1'){
				$ik3 = $ik;
			}elseif(substr($ik2,2,1)=='1'){
				$ik3 = $ik2;
			}else{
				ERROR("内部错误找绿坝娘和馆里猿吧","SEIRI ERROR","ITEM2",__FUNCTION__,__LINE__);
			}
		}

		$item[$wk] = $itn.'<>'.$ik3;
		$itai[$wk] = $itai[$wk] + $itai[$wk2];
		$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
		$ik3 = '';
	}elseif($ik == $ik2){#タイプ同一
		if($ik=='Y' && strpos($itn,'子弹')!==false){#子弹
			$eff[$wk] = $eff[$wk] + $eff[$wk2];
			$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
		}elseif(preg_match('/<>WC|<>WD|<>TN|御神签|磨刀石|钉|解毒剂|裁缝道具|电池|火药/',$item[$wk])){#纏める要素
			if($eff[$wk] == $eff[$wk2]){#効果同一
				$itai[$wk] = $itai[$wk] + $itai[$wk2];
				$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
			}elseif(!preg_match('/<>WC|<>WD|<>TN/',$item[$wk])){#不一致
				$itai[$wk] *= $eff[$wk];
				$itai[$wk2] *= $eff[$wk2];
				$eff[$wk] = 1;
				$itai[$wk] += $itai[$wk2];
				$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
			}else{
				$ik3 = 1;
			}
		}else{
			$ik3 = 1;
		}
	}else{
		$ik3 = 1;
	}
}else{
	$ik3 = 1;
}

if($ik3){ #違うアイテム・纏められない物選択
	$log .= $itn.' 和 '.$itn2.' 没办法合并呢。<br>';
}else{
	$log .= $itn.' 进行了合并。<br>';
}

$in['Command'] = 'MAIN';
$in['Command2'] = '';

SAVE();

}
#=================#
# ■ アイテム合成 #
#=================#
function ITEMGOUSEI(){
global $in;

global $item,$itai,$log,$wk1,$wk2,$wk3,$itn1,$itn2,$itn3,$ik1,$ik2,$ik3,$j,$gousei;
$gousei=1;
$wk1 = $in['Command'];
if($wk1 == "GOUSEI1_N"){
	$wk1 = "无";$gousei--;
}else{
	$wk1 = preg_replace("/GOUSEI1_/","",$wk1);
	list($itn1, $ik1) = explode("<>",$item[$wk1]);
}
$wk2 = $in['Command2'];
if($wk2 == "GOUSEI2_N"){
	$wk2 = "无";$gousei--;
}else{
	$wk2 = preg_replace("/GOUSEI2_/","",$wk2);
	list($itn2, $ik2) = explode("<>",$item[$wk2]);
}
$wk3 = $in['Command3'];
if($wk3 == "GOUSEI3_N"){
	$wk3 = "无";$gousei--;
}else{
	$wk3 = preg_replace("/GOUSEI3_/","",$wk3);
	list($itn3, $ik3) = explode("<>",$item[$wk3]);
}

if($gousei == 0){
	if($wk1 == "无"){
		$wk1 = $wk3;
		$wk3 = "无";
		$itn1 = $itn3;
		$itn3 = "";
		$ik1 = $ik3;
		$ik3 = "";
	}elseif($wk2 == "无"){
		$wk2 = $wk3;
		$wk3 = "无";
		$itn2 = $itn3;
		$itn3 = "";
		$ik2 = $ik3;
		$ik3 = "";
	}
	if($wk3 != "无"){
		ERROR("Internal Server ERROR","","ITEM2",__FUNCTION__,__LINE__);
	}
}

if($gousei < 0){$log = ($log . "没有正确选择道具。<br>");}
else{
	$chk = "NG";
	if (($itai[$wk1] == 1)||($itai[$wk1] == "∞")){
		$chk = "ON";$itai[$wk1] == 1;$j=$wk1;
	}elseif(preg_match("/DB|DH|DF|DA/",$ik1)){
		$chk = "ON";$j=$wk1;
	}elseif(($itai[$wk2] == 1)||($itai[$wk2] == "∞")){
		$chk = "ON";$itai[$wk2] == 1;$j=$wk2;
	}elseif(preg_match("/DB|DH|DF|DA/",$ik2)){
		$chk = "ON";$j=$wk2;
	}elseif(($gousei == 1)&&(($itai[$wk3] == 1)||($itai[$wk3] == "∞"))){
		$chk = "ON";$itai[$wk3] == 1;$j=$wk3;
	}elseif(($gousei == 1)&&(preg_match("/DB|DH|DF|DA/",$ik3))){
		$chk = "ON";$j=$wk3;
	}else{
		for ($j=0;$j<5;$j++){
			if($item[$j] == "无"){
				$chk = "ON";
				break;
			}
		}
	}

	if($chk=='NG'){
		$log .= '包包装不下了。<br>';
	}else{#アイテム合成振り分け２個・３個・ERROR
		if($gousei == 0){ITEMGOUTWO();}
		elseif($gousei == 1){ITEMGOUTHREE();}
		else{ERROR("Internal Server ERROR","","ITEM2",__FUNCTION__,__LINE__);}
	}
}
$in['Command'] = "MAIN";
$in['Command2'] = "";

SAVE();

}
#==================#
# ■ アイテム合成2 #
#==================#
function ITEMGOUTWO(){
global $log,$wk1,$wk2,$itn1,$itn2,$j,$item,$eff,$itai;
$log .= '合成道具。<br>';
if($wk1==$wk2 || $itn1==$itn2){//同アイテム選択？
	$log .= $itn1.'放在手中端详一番。<br>';
}else{
	global $g_item1,$g_item2,$g_item3,$g_name,$g_kind,$g_eff,$g_itai;
	ITEMTABLE();
	#テーブル作成
	$k = 0;
	$l = count($g_item1);
	for($k=0; $k<$l; $k++){
		$gousei[$g_item1[$k]][$g_item2[$k]]['name'] = $g_name[$k];
		$gousei[$g_item1[$k]][$g_item2[$k]]['kind'] = $g_kind[$k];
		$gousei[$g_item1[$k]][$g_item2[$k]]['eff']  = $g_eff[$k];
		$gousei[$g_item1[$k]][$g_item2[$k]]['itai'] = $g_itai[$k];
	}
	if($gousei[$itn1][$itn2]['name']){ #合成テーブル使用合成
		$log .= $itn1.'和'.$itn2.'捣腾出了'.$gousei[$itn1][$itn2]['name'].'！<BR>';
		$item[$j] = $gousei[$itn1][$itn2]['name'].'<>'.$gousei[$itn1][$itn2]['kind'];
		$eff[$j] = $gousei[$itn1][$itn2]['eff'];
		$itai[$j] = $gousei[$itn1][$itn2]['itai'];
		ITEMCOUNT();
	}elseif($gousei[$itn2][$itn1]['name']){ #合成テーブル使用合成(逆)
		$log .= $itn1.'和'.$itn2.'捣腾出了'.$gousei[$itn2][$itn1]['name'].'た！<BR>';
		$item[$j] = $gousei[$itn2][$itn1]['name'].'<>'.$gousei[$itn2][$itn1]['kind'];
		$eff[$j] = $gousei[$itn2][$itn1]['eff'];
		$itai[$j] = $gousei[$itn2][$itn1]['itai'];
		ITEMCOUNT();
	}else{$log .= $itn1.'和'.$itn2.'捣腾不出什么东西。<br>';}#違うアイテム・合成できない物選択
}
}
#==================#
# ■ アイテム合成3 #
#==================#
function ITEMGOUTHREE(){
global $log,$wk1,$wk2,$wk3,$itn1,$itn2,$itn3,$j,$item,$eff,$itai;
$log .= '合成道具。<br>';
if(($wk1==$wk2 || $itn1==$itn2) || ($wk1==$wk3 || $itn1==$itn3)){$log .= $itn1.'放在手中端详一番。<br>';}#同アイテム選択？
elseif($wk2==$wk3 || $itn2==$itn3){$log .= $itn2.'放在手中端详一番。<br>';}
else{
	global $g_item1,$g_item2,$g_item3,$g_name,$g_kind,$g_eff,$g_itai;
	ITEMTABLE();
	#テーブル作成
	$k = 0;
	$l = count($g_item1);
	for($k=0;$k<$l;$k++){
		$gousei[$g_item1[$k]][$g_item2[$k]][$g_item3[$k]]['name'] = $g_name[$k];
		$gousei[$g_item1[$k]][$g_item2[$k]][$g_item3[$k]]['kind'] = $g_kind[$k];
		$gousei[$g_item1[$k]][$g_item2[$k]][$g_item3[$k]]['eff']  = $g_eff[$k];
		$gousei[$g_item1[$k]][$g_item2[$k]][$g_item3[$k]]['itai'] = $g_itai[$k];
	}
	if($gousei[$itn1][$itn2][$itn3]['name']){ #合成テーブル使用合成1
		$log .= $itn1.'和'.$itn2.'和'.$itn3.'捣腾出了'.$gousei[$itn1][$itn2][$itn3]['name'].'！<BR>';
		$item[$j] = $gousei[$itn1][$itn2][$itn3]['name'].'<>'.$gousei[$itn1][$itn2][$itn3]['kind'];
		$eff[$j] = $gousei[$itn1][$itn2][$itn3]['eff'];
		$itai[$j] = $gousei[$itn1][$itn2][$itn3]['itai'];
		ITEMCOUNT();
	}elseif($gousei[$itn1][$itn3][$itn2]['name']){#合成テーブル使用合成2
		$log .= $itn1.'和'.$itn2.'和'.$itn3.'捣腾出了'.$gousei[$itn1][$itn3][$itn2]['name'].'！<BR>';
		$item[$j] = $gousei[$itn1][$itn3][$itn2]['name'].'<>'.$gousei[$itn1][$itn3][$itn2]['kind'];
		$eff[$j] = $gousei[$itn1][$itn3][$itn2]['eff'];
		$itai[$j] = $gousei[$itn1][$itn3][$itn2]['itai'];
		ITEMCOUNT();
	}elseif($gousei[$itn2][$itn1][$itn3]['name']){#合成テーブル使用合成3
		$log .= $itn1.'和'.$itn2.'和'.$itn3.'捣腾出了'.$gousei[$itn2][$itn1][$itn3]['name'].'！<BR>';
		$item[$j] = $gousei[$itn2][$itn1][$itn3]['name'].'<>'.$gousei[$itn2][$itn1][$itn3]['kind'];
		$eff[$j] = $gousei[$itn2][$itn1][$itn3]['eff'];
		$itai[$j] = $gousei[$itn2][$itn1][$itn3]['itai'];
		ITEMCOUNT();
	}elseif($gousei[$itn2][$itn3][$itn1]['name']){#合成テーブル使用合成4
		$log .= $itn1.'和'.$itn2.'和'.$itn3.'捣腾出了'.$gousei[$itn2][$itn3][$itn1]['name'].'！<BR>';
		$item[$j] = $gousei[$itn2][$itn3][$itn1]['name'].'<>'.$gousei[$itn2][$itn3][$itn1]['kind'];
		$eff[$j] = $gousei[$itn2][$itn3][$itn1]['eff'];
		$itai[$j] = $gousei[$itn2][$itn3][$itn1]['itai'];
		ITEMCOUNT();
	}elseif($gousei[$itn3][$itn2][$itn1]['name']){#合成テーブル使用合成5
		$log .= $itn1.'和'.$itn2.'和'.$itn3.'捣腾出了'.$gousei[$itn3][$itn2][$itn1]['name'].'！<BR>';
		$item[$j] = $gousei[$itn2][$itn3][$itn1]['name'].'<>'.$gousei[$itn3][$itn2][$itn1]['kind'];
		$eff[$j] = $gousei[$itn3][$itn2][$itn1]['eff'];
		$itai[$j] = $gousei[$itn3][$itn2][$itn1]['itai'];
		ITEMCOUNT();
	}elseif($gousei[$itn3][$itn1][$itn2]['name']){#合成テーブル使用合成6
		$log .= $itn1.'和'.$itn2.'和'.$itn3.'捣腾出了'.$gousei[$itn3][$itn1][$itn2]['name'].'！<BR>';
		$item[$j] = $gousei[$itn3][$itn1][$itn2]['name'].'<>'.$gousei[$itn3][$itn1][$itn2]['kind'];
		$eff[$j] = $gousei[$itn3][$itn1][$itn2]['eff'];
		$itai[$j] = $gousei[$itn3][$itn1][$itn2]['itai'];
		ITEMCOUNT();
	}else{$log .= $itn1.'和'.$itn2.'和'.$itn3.'捣腾不出什么东西。<br>';}#違うアイテム・合成できない物選択
}
}
#=====================#
# ■ アイテムカウント #
#=====================#
function ITEMCOUNT(){
global $j,$wk1,$wk2,$wk3,$ik1,$ik2,$ik3,$item,$eff,$itai,$gousei;
if($wk1 == $j){
	if(preg_match('/DB|DH|DF|DA/',$ik2)){$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;}
	else{$itai[$wk2] -= 1;if($itai[$wk2] <= 0){$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;}}
	if($gousei == 1){
		if(preg_match('/DB|DH|DF|DA/',$ik3)){$item[$wk3] = '无';$eff[$wk3] = 0;$itai[$wk3] = 0;}
		else{$itai[$wk3] -= 1;if($itai[$wk3] <= 0){$item[$wk3] = '无';$eff[$wk3] = 0;$itai[$wk3] = 0;}}
	}
}elseif($wk2 == $j){
	if(preg_match('/DB|DH|DF|DA/',$ik1)){$item[$wk1] = '无';$eff[$wk1] = 0;$itai[$wk1] = 0;}
	else{$itai[$wk1] -= 1;if($itai[$wk1] <= 0){$item[$wk1] = '无';$eff[$wk1] = 0;$itai[$wk1] = 0;}}
	if($gousei == 1){
		if(preg_match('/DB|DH|DF|DA/',$ik3)){$item[$wk3] = '无';$eff[$wk3] = 0;$itai[$wk3] = 0;}
		else{$itai[$wk3] -= 1;if($itai[$wk3] <= 0){$item[$wk3] = '无';$eff[$wk3] = 0;$itai[$wk3] = 0;}}
	}
}elseif(($gousei == 1)&&($wk3 == $j)){
	if(preg_match('/DB|DH|DF|DA/',$ik1)){$item[$wk1] = '无';$eff[$wk1] = 0;$itai[$wk1] = 0;}
	else{$itai[$wk1] -= 1;if($itai[$wk1] <= 0){$item[$wk1] = '无';$eff[$wk1] = 0;$itai[$wk1] = 0;}}
	if(preg_match('/DB|DH|DF|DA/',$ik2)){$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;}
	else{$itai[$wk2] -= 1;if($itai[$wk2] <= 0){$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;}}
}else{
	if(preg_match('/DB|DH|DF|DA/',$ik1)){
		$item[$wk1] = '无';$eff[$wk1] = 0;$itai[$wk1] = 0;
	}else{
		$itai[$wk1] -= 1;
		if($itai[$wk1] <= 0){
			$item[$wk1] = '无';$eff[$wk1] = 0;$itai[$wk1] = 0;
		}
	}
	if(preg_match('/DB|DH|DF|DA/',$ik2)){
		$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
	}else{
		$itai[$wk2] -= 1;
		if($itai[$wk2] <= 0){
			$item[$wk2] = '无';$eff[$wk2] = 0;$itai[$wk2] = 0;
		}
	}
	if($gousei == 1){
		if(preg_match('/DB|DH|DF|DA/',$ik3)){
			$item[$wk3] = '无';$eff[$wk3] = 0;$itai[$wk3] = 0;
		}else{
			$itai[$wk3] -= 1;
			if($itai[$wk3] <= 0){
				$item[$wk3] = '无';$eff[$wk3] = 0;$itai[$wk3] = 0;
			}
		}
	}
}
}
#=====================#
# ■ アイテムテーブル #
#=====================#
function ITEMTABLE(){
global $g_item1,$g_item2,$g_item3,$g_name,$g_kind,$g_eff,$g_itai;
#アイテム合成用テーブルデータ
#合成素材１
$g_item1 = array(	'轻油',	'汽油',		    '信管',		'火药',				'喷雾罐',		    	'手机',	    	'杂烩',		'面包',		'豆沙馅');
#合成素材２
$g_item2 = array(	'肥料',	'空瓶',     	'火药',		'导火线',			'打火机',				'笔记本电脑',	'蘑菇',		'咖喱',	    '面包');
#合成素材３
$g_item3 = array(	'无',	'无',			'无',		'无',				'无',					'无',			'无',		'无',	 	'无');
#合成アイテム名称
$g_name = array(	'火药',	'☆燃烧瓶☆',	'☆爆弾☆',	'☆硝化甘油☆',	   '☆火焰喷射器☆',    	'移动PC',   	'蘑菇堡饭',	'咖喱面包', '豆沙面包');
#合成アイテム種類
$g_kind = array(	'Y',	'WD',			'WD',		'WD',				'WG',					'Y',			'SH',		'HH',		'SH');
#合成アイテム効果値
$g_eff = array(		'1',	'45',			'50',		'99',				'100',					'1',			'100',		'100',		'200');
#合成アイテム耐久度
$g_itai = array(	'1',	'1',			'1',		'12',				'10',					'0',			'3',		'4',		'3');
}
?>